Pipeline transportation is the main means to transport oil and gas and other important materials, and the damage of buried pipelines by earthquake is difficult to repair. Based on the nonlinear dynamic theory, the ANSYS finite element software was used to establish the pipeline?soil model, and then the nonlinear contact model between pipeline and soil was established. Finally, different seismic waves were applied to the buried pipeline and compared. The results show that the upper and lower parts of the pipeline have large displacements under the influence of seismic waves; as the input seismic waves gradually increase, the displacement of the lower part of the pipeline decreases, but it is still greater than the displacement on both sides of the pipeline. It can be seen that the upper and lower parts of the pipeline will be greatly affected when an earthquake occurs.